﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/People.Master" Inherits="System.Web.Mvc.ViewPage<MedicalManagementSystem.Models.Patient>" %>
<%@ Import Namespace="MedicalManagementSystem.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Редактирование пациента
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainRightColumn" runat="server">

<h2>Редактирование пациента <%=Model.Initials%></h2>
    <%= Html.ExportJS("jquery.maskedinput-1.3.min.js") %>
    <%= Html.ValidationSummary("Пожалуйста, исправьте ошибки и попробуйте снова.") %>

    <%using(Html.BeginForm()){%>
       <fieldset>
            <label for="Surname">Фамилия:</label>
            <%= Html.TextBox("Surname") %>
            <%= Html.ValidationMessage("Surname","*") %>
            
            <label for="Name">Имя:</label>
            <%= Html.TextBox("Name") %>
            <%= Html.ValidationMessage("Name","*") %>
            
            <label for="Patronymic">Отчество:</label>
            <%= Html.TextBox("Patronymic") %>
            <%= Html.ValidationMessage("Patronymic","*") %>
            
            <label for="Sex">Пол:</label>
            <div id="radio">
                <input type="radio" id="sexM" name="Sex" value = "true" <% if (Model.Sex) { %>checked="checked" <%} %> />
                <label for="sexM">Мужской</label>
		        
                <input type="radio" id="sexW" name="Sex" value = "false" <% if (!Model.Sex) { %>checked="checked" <%} %>/>
                <label for="sexW">Женский</label>
		    </div>

            <label for="Birthday">Дата рожения:</label>
            <%= Html.TextBox("Birthday", Model.Birthday.ToShortDateString()) %>
            <%= Html.ValidationMessage("Birthday","*") %>
            
            <label for="CardName">Номер карты:</label>
            <%= Html.TextBox("CardName") %>
            <%= Html.ValidationMessage("CardName","*") %>
            
            <label for="Note">Комментарий:</label>
            <%= Html.TextArea("Note") %>
            <%= Html.ValidationMessage("Note","*") %>
            
            <p>
                <input type="submit" value="Сохранить" />
            </p>
       </fieldset>
    <%} %>
    <%=Html.ActionLink("Назад","Details",new{Model.id}) %>
    <script language="javascript" type="text/javascript">
        $(function () {
            $("#Birthday").mask('99/99/9999');
            $("#radio").buttonset();
        });
    </script>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
